// 聊天消息类型
export interface ChatMessage {
  id: string
  role: 'user' | 'assistant'
  content: string
  timestamp: number
  status: 'sending' | 'sent' | 'error'
  metadata?: {
    model?: string
    tokens?: number
    processingTime?: number
  }
}

// 聊天会话类型
export interface ChatSession {
  id: string
  title: string
  messages: ChatMessage[]
  createdAt: number
  updatedAt: number
}

// 聊天状态类型
export interface ChatState {
  isOpen: boolean
  isLoading: boolean
  messages: ChatMessage[]
  currentSession: string | null
  sessions: ChatSession[]
  unreadCount: number
  error: string | null
}

// 聊天服务响应类型
export interface ChatResponse {
  message: string
  success?: boolean
  timestamp?: number
  metadata?: {
    model: string
    tokens: number
    processingTime: number
  }
}

// 聊天服务错误类型
export interface ChatError {
  code: string
  message: string
  details?: any
}

// 聊天配置类型
export interface ChatConfig {
  maxMessages: number
  maxMessageLength: number
  autoSave: boolean
  theme: 'light' | 'dark'
  language: string
}
